define(function(require, exports, module) {

  var Backbone = require('backbone');
  var $ = require('jquery');
  var _ = require('underscore');
  var jsonview = require('jsonview');
  var tmpl = require('text!../tmpl.html');

  require('css!../style.css')

  function main() {
    var $app = $('<div id="app">');
    $('#main').html($app);

    $app.append(tmpl);

    for (var i = 0 ; i < 1000; i++) {
      $app.append($('<div>').html(i))
    }

    console.time('doubleHeight')
    document.getElementById('app').querySelectorAll('div').forEach(doubleHeight2)
    console.timeEnd('doubleHeight')

    console.time('doubleHeight_fast')
    document.getElementById('app').querySelectorAll('div').forEach(doubleHeight_fast)
    console.timeEnd('doubleHeight_fast')
  }

  function doubleHeight(element) {
    var currentHeight = element.clientHeight
    element.style.height = (currentHeight * 2) + 'px'
  }

  function doubleHeight2(element) {
    var currentHeight = element.clientHeight
    element.style.cssText = 'height:' + (currentHeight * 2) + 'px'
  }

  function doubleHeight_fast(element) {
    var currentHeight = element.clientHeight
    window.requestAnimationFrame(function() {
      element.style.height = (currentHeight * 2) + 'px'
    })
  }

  //大量修改dom时，下面的速度快

  return main;
})
